//`define C3D_DEBUG

//`define C3D_MULT_IMPLEMENTED

`define C3D_CLOCK_MHZ           25

// VGA扫描
`define C3D_VGA_MHZ             25

`define C3D_X_ACTIVE_WIDTH      640
`define C3D_X_SYNC_BEGIN        656
`define C3D_X_SYNC_END          752
`define C3D_X_TOTAL_WIDTH       800

`define C3D_Y_ACTIVE_HEIGHT     480
`define C3D_Y_SYNC_BEGIN        491
`define C3D_Y_SYNC_END          493
`define C3D_Y_TOTAL_HEIGHT      524

// 操作数，寄存器位宽
`define C3D_OPERAND_WIDTH		32
`define C3D_REGFILE_ADDR_WIDTH	5

// ALU操作码
`define C3D_ALUOP_WIDTH	        4
`define C3D_ALUOP_NOP	        4'd0
`define C3D_ALUOP_ADD	        4'd1
`define C3D_ALUOP_SUB	        4'd2
`define C3D_ALUOP_AND	        4'd3
`define C3D_ALUOP_OR		    4'd4
`define C3D_ALUOP_XOR	        4'd5
`define C3D_ALUOP_MUL	        4'd6
`define C3D_ALUOP_IMM	        4'd7
`define C3D_ALUOP_COMP	        4'd8
`define C3D_ALUOP_CMOV          4'd9

// 比较操作码
`define C3D_COMPOP_WIDTH	    4
`define C3D_COP_SFEQ            3'b000
`define C3D_COP_SFNE            3'b001
`define C3D_COP_SFGT            3'b010
`define C3D_COP_SFGE            3'b011
`define C3D_COP_SFLT            3'b100
`define C3D_COP_SFLE            3'b101
`define C3D_COP_X               3'b111

// 光栅化
`define C3D_COORD_WIDTH         16

`define C3D_TOPOLOGY_WIDTH      4
`define C3D_TOPOLOGY_TRIANGLE   4'd0

`define C3D_RESOLUTION_X        128
`define C3D_RESOLUTION_Y        64

`define C3D_RASTERIZE_STEP_X   8
`define C3D_RASTERIZE_STEP_Y   8